package com.yuanfeng.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanfeng.business.dto.FxGoodsInfoDTO;
import com.yuanfeng.business.dto.OperateFxGoodsDTO;
import com.yuanfeng.business.entity.ShopFxGoodsInfoEntity;
import com.yuanfeng.business.vo.GoodsListVO;
import com.yuanfeng.commoms.dto.goods.FxGoodsListDTO;
import com.yuanfeng.commoms.vo.activity.AppDiscountGoodsQueryResultVO;
import com.yuanfeng.commoms.vo.activity.AppPintuanGoodsQueryResultVO;
import com.yuanfeng.commoms.vo.fx.ShareGoodsVO;
import com.yuanfeng.commoms.vo.goods.FXGoodsListVO;
import com.yuanfeng.commoms.vo.goodscat.WebCatMenuVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName ShopFxGoodsInfoMapper
 * @Description
 * @Author cyp
 * @Date 2023-05-30 11:02:28
 * @Version 1.0
 **/
@Mapper
public interface ShopFxGoodsInfoMapper extends BaseMapper<ShopFxGoodsInfoEntity> {

     /**
      * 分销商品数量更新
      * @param shareGoodsList
      * @return
      */
     int updateGoodsSaleNum(@Param("shareGoodsList")List<ShareGoodsVO> shareGoodsList);

    /**
     * 店铺商品集合
     * @param page
     * @param param
     * @return
     */
    IPage<FxGoodsInfoDTO> queryFxGoodsList(Page<FxGoodsInfoDTO> page,@Param("param") FxGoodsInfoDTO param);

    List<FxGoodsInfoDTO> queryFxGoodsListNoLimit(@Param("param") FxGoodsInfoDTO param);

    /**
     * 店铺商品
     * @param page
     * @param fxGoodsInfo
     * @return
     */
    IPage<GoodsListVO> queryFxGoods(Page<GoodsListVO> page,@Param("param") FxGoodsInfoDTO fxGoodsInfo);

    List<GoodsListVO> queryFxGoodsNoLimit(@Param("param") FxGoodsInfoDTO fxGoodsInfo);

    int insertSelective(@Param("param") FxGoodsInfoDTO record);

    int updateByPrimaryKeySelective(@Param("param") FxGoodsInfoDTO record);

    List<GoodsListVO> queryFxGoodsBatch(@Param("shopId") Integer shopId,@Param("goodsIdList") List<Integer> goodsIdList);

    List<FxGoodsInfoDTO> queryFxGoodsListBatch(@Param("goodsIdList") List<Integer> goodsIdList, @Param("goodsStatus") Integer goodsStatus);

    int insertSelectiveBatch(@Param("records") List<FxGoodsInfoDTO> fxGoodsInfoList);

    int fxGoodsPutawayBatch(@Param("param") OperateFxGoodsDTO record);

    int soldOutBatch(@Param("goodsIdList") List<Integer> goodsIdList);

    int deleteBatch(@Param("goodsIdList") List<Integer> goodsIdList);

    IPage<FXGoodsListVO> findFxGoodsList(Page<FXGoodsListVO> page,@Param("param") FxGoodsListDTO goodsListRequest);

    AppDiscountGoodsQueryResultVO selectByGoodsId2(@Param("goodsId") Integer goodsId);

    AppPintuanGoodsQueryResultVO selectPintuanGoodsDetail(@Param("commonId") Integer commonId,@Param("goodsId") Integer goodsId);

    /**
     * 查询所有子分类
     * @return
     */
    List<WebCatMenuVO> selectAllCat2();
 }
